/*
 * @Description: element 组件
 * @Author: DHL
 * @Date: 2022-01-12 16:52:41
 * @LastEditors: DHL
 * @LastEditTime: 2023-05-22 15:41:38
 */
import type { App } from 'vue'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import 'dayjs/locale/zh-cn'

import { useAppStore } from '../store/modules/app'

export function setupElementPlugins(app: App<Element>) {
  // 注册所有图标
  for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }


  app.use(ElementPlus, { size: useAppStore().getSize, locale: zhCn, zIndex: 3000 })
}
